<?php

namespace sample\controller;

use pmvc\mvc\controller\BaseController;
use pmvc\mvc\Request;
use pmvc\mvc\Response;

class HomePageController
	extends BaseController {

	public function handleRequest(Request $request, Response $response) {
		if ($request->getParameter("throwException", 0)=="1") {
			throw new \Exception("This is a sample error from the default error controller.");
		}
		$response->getModel()->set("message", "Why hello there");
		return parent::getDefaultViewName();
	}
}

?>